<template>
  <view class="myPosP">
    <view class="searchPP">
      <img
        @click="goBackM"
        style="width: 0.6rem; height: 1rem; padding: 0rem 0.5rem 0rem 0rem"
        src="../../style/image/cargo/leftarow.jpg"
        alt=""
      />
      <view class="searchP">
        <view class="search" :style="{ width: '100%' }">
          <u-search
            placeholder="请输入商户名称"
            shape="round"
            v-model="keyword"
            :show-action="false"
          ></u-search>
        </view>
        <!-- <view @click="celendarM" class="celendar">
                <img :style="{ width:'1.1rem',height:'1.1rem', margin:'0rem 0.5rem'}" src="../../style/image/stati/日历@3x.png" alt="">
                <view>2019.10.09</view>
                </view> -->
      </view>
    </view>

    <view class="a">
      <view class="allDataC-item-content">
        <view class="itemData">
          <view>98.00</view>
          <view class="dataText">总商户数</view>
        </view>
        <view class="itemData">
          <view>98</view>
          <view class="dataText">无设备商户数</view>
        </view>
        <view class="itemData">
          <view>9</view>
          <view class="dataText">设备不在线</view>
        </view>
      </view>
    </view>

    <view class="b">
      <view style="background-color: white">
        <u-dropdown>
          <u-dropdown-item
          
            v-model="value4"
            title="状态"
            active-color='#01b075'
            :options="options4"
          ></u-dropdown-item>
          <u-dropdown-item
            v-model="value3"
            title="排序"
            active-color='#02b075'
            :options="options3"
          ></u-dropdown-item>
        </u-dropdown>
      </view>
    </view>

    <view class="c">
      <view
        style="background-color: #f3f5f7; padding: 1rem"
        class="repairListsP"
      >
        <view
          class="repairLists"
          v-for="(item, index) in repairLists"
          :key="index"
        >
          <view class="repairLists-child"  @click="goposDetailedM" >
            <view class="repairLists-top">
              <view style="display: flex; align-items: center">
                <img
                  style="width: 1rem; margin-right: 0.3rem"
                  src="../../style/image/myPos/mypos.png"
                  alt=""
                />
                <view>
                  商户名称：<span
                    style="background: rgb(255, 237, 237) none repeat scroll 0% 0%;
padding: 0.2rem;
border-radius: 3px;
color: #D03434;
font-size: 0.5rem;"
                    >绝对分润50.0%</span
                  >
                </view>
              </view>

              <view style="
font-size: 0.65rem;
font-family: PingFang SC;
font-weight: 300;
color: #02AF74;" >在线</view>
            </view>

            <view class="repairLists-head">
              <view
                style="
                  display: flex;
                  align-items: center;
                  justify-content: space-between;
                  margin: 0.2rem 0rem;
                "
              >
                <view
                  style="
                    font-size: 0.72rem;
                    font-family: PingFang SC;
                    font-weight: 300;
                    color: #333333;
                  "
                >
                  创建时间
                </view>
                <view
                  style="
                    font-size: 0.72rem;
                    font-family: PingFang SC;
                    font-weight: 300;
                    color: #333333;
                  "
                >
                  拉卡拉总代理111
                </view>
              </view>
              <view
                style="
                  display: flex;
                  align-items: center;
                  justify-content: space-between;
                  margin: 0.2rem 0rem;
                "
              >
                <view
                  style="
                    font-size: 0.72rem;
                    font-family: PingFang SC;
                    font-weight: 300;
                    color: #333333;
                  "
                >
                  计费制度
                </view>
                <view
                  style="
                    font-size: 0.72rem;
                    font-family: PingFang SC;
                    font-weight: 300;
                    color: #333333;
                  "
                >
                  123456781111
                </view>
              </view>
              <view
                style="
                  display: flex;
                  align-items: center;
                  justify-content: space-between;
                  margin: 0.2rem 0rem;
                "
              >
                <view
                  style="
                    font-size: 0.72rem;
                    font-family: PingFang SC;
                    font-weight: 300;
                    color: #333333;
                  "
                >
                  商户收益
                </view>
                <view
                  style="
                    font-size: 0.72rem;
                    font-family: PingFang SC;
                    font-weight: 300;
                    color: #333333;
                  "
                >
                  <span style="color: #FF0000 " >¥9.00</span>
                </view>
              </view>
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script lang='ts' >
import { Component, Prop, Vue, Watch, Emit } from "vue-property-decorator";

@Component({
  //   @Component  是一个装修器   不可以在下面写语句
  name: "test",
})
export default class extends Vue {
  @Prop({
    type: String, // 父组件传递给子组件的数据类型
    required: false, // 是否必填
    default: " ", // 默认值， 如果传入的是 Object，则要 default: ()=>({}) 参数为函数
  })
  msg!: string;

  public value4 = 1;
  public value3 = 2;
  public options1 = [
    {
      label: "默认排序",
      value: 1,
    },
    {
      label: "距离优先",
      value: 2,
    },
    {
      label: "价格优先",
      value: 3,
    },
  ];
  public options3 = [
    {
      label: "综合",
      value: 1,
    },
    {
      label: "收益从高到低",
      value: 2,
    },
    {
      label: "收益从低到高",
      value: 3,
    },
    {
      label: "创建时间由近到远",
      value: 4,
    },
    {
      label: "创建时间由远到近",
      value: 5,
    }
  ];
  public options4 = [
    {
      label: "全部",
      value: 1,
    },
    {
      label: "已铺货",
      value: 2,
    },
    {
      label: "未铺货",
      value: 3,
    },
    {
      label: "掉线",
      value: 4,
    },
    {
      label: "在线",
      value: 5,
    },
  ]

  public repairLists = [
    {
      mainTitle: "拉卡拉总代理",
    },
    {
      mainTitle: "拉卡拉总代理",
    },
  ];

  created() {}

  mounted() {
    //  console.log('父组件传递的参数:',this.$parent)   //暂时不考虑

  }
  goBackM(){

     uni.navigateTo({
    url: '../home/home'
    });

  }
  goposDetailedM(){
  
      console.log('商户详情')

        uni.navigateTo({
    url: './posDetailed'
    });

  }
}
</script>

<style  scoped>
.myPosP{
  background-color: #f3f5f7;
  height: 100vh;
}

.searchPP {
  background-color: white;
  padding: 0.5rem;

  display: flex;
  align-items: center;
  border-bottom: 1px solid #e8e8e8;
}
.searchP {
  background-color: white;
  display: flex;
  width: 100%;
  justify-content: space-between;
}

.allDataC-item-content {
 background-color: white;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid#e8e8e8;
}

.itemData {
  text-align: center;
  padding: 1rem 0.5rem;
  width: 25%;
  text-align: center;
}
.itemData :first-child {
  margin-bottom: 0.3rem;
}

.dataText {
  font-size: 0.67rem;
  font-family: PingFang SC;
  font-weight: 399;
  color: #000000;
}

.repairLists {
  background-color: white;
  margin-bottom: 1rem;
  border-radius: 0.2rem;
  /* padding: 1rem; */
  /* margin: 1rem; */
}

.repairLists-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.5rem;
  border-bottom: 1px solid #e8e8e8;
}

.repairLists-child {
  border-bottom: 1px solid #e5e5e5;
}
.repairLists-head {
  padding: 1rem;
}

.repairBtn {
  width: 4.5rem;
  height: 1.5rem;
  background: #ffffff;
  border: 1px solid #02af74;
  border-radius: 0.3rem;
  font-size: 0.78rem;
  font-family: PingFang SC;
  font-weight: 300;
  color: #02b074;
  text-align: center;
  align-items: center;
  line-height: 1.5rem;
}
</style>